package com.fsy.spring.annotation1;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ApplicationObjectSupport;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * Created by shuangyu.feng on 2017/8/9.
 */
@Component
public class AnnotationPersonRedesiter extends ApplicationObjectSupport{

	@Override
	protected void initApplicationContext(ApplicationContext context) throws BeansException {
		super.initApplicationContext();
		String[] beanNames = context.getBeanNamesForAnnotation(Person.class);
		for(String name : beanNames){
			System.out.println(name);
		}
	}
}
